<%-- 
    Document   : cadastro
    Created on : 29/06/2012, 16:15:34
    Author     : Rodrigo
--%>

<%@page import="model.Usuario"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/styleTeste.css" type="text/css" >
    </head>
    <body>
        <div class="all">
            -
            <div class="content">

                <div class="banner">  
                    <a href="index.jsp">
                        <img border="0" src="imgs/banner.png" />
                    </a>
                </div>

                <div class="separator">
                </div>

                <div class="formulario">
                    <form action="CadastroServlet" method="post">
                        <h2> Formulário </h2>
                        <div style="float: left; position: relative; width: 150px;">

                            <div>
                                <label>Usuário:</label>
                            </div>
                            <div class="campos">
                                <label>E-mail:</label>
                            </div>

                            <div class="campos">
                                <label>Senha:</label>
                            </div>

                            <div class="campos">
                                <label>Repetir senha:</label>
                            </div>

                            <div style="float:left;">
                                <a href="index.jsp" >
                                    <div class="buttonvoltar" style="float: left;"></div>
                                </a>
                            </div>

                        </div>

                        <div style="float: left; position: relative;">
                            <div> 
                                <input class="textinput" type="text" name="user" size="30"/>
                            </div>

                            <div class="campospreenchidos">
                                <input class="textinput" type="text" name="email" size="30"/>
                            </div>

                            <div class="campospreenchidos">
                                <input class="textinput" type="password" name="senha" size="30"/>                                           
                            </div>

                            <div class="campospreenchidos">
                                <input class="textinput" type="password" name="resenha" size="30" />
                            </div>

                            <div style="float: right; width: 100px;">
                                <button type="submit"  class="buttoncadastro"> </button>
                            </div>
                        </div>

                    </form>

                    <div>
                        <label class="text" style="clear: both; float: left; width: 400px;">
                            <%
                                String invalido = (String) session.getAttribute("cadastroInvalido");
                                if (invalido != null) {
                                    if (invalido.equals("true")) {
                                        out.write((String) session.getAttribute("msgErro"));
                                    } else {
                                        out.write("<font color = green>Usuário cadastrado com sucesso!</font>");
                                    }
                                }
                            %>
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <% request.getSession().setAttribute("cadastroInvalido", null);%>
    </body>
</html>
